package com.xxhui.spidermapdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.xxhui.spidermapdemo.bean.SpiderDate;
import com.xxhui.spidermapdemo.view.SpiderMap;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private SpiderMap map;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        map = (SpiderMap) findViewById(R.id.SpiderMap);
        map.setSize(6);
        map.setList(getDate(6));
    }

    public List<SpiderDate> getDate(int size){
        List<SpiderDate> list = new ArrayList<SpiderDate>();
        for(int i=0 ;i < size ; i++){
            SpiderDate date = new SpiderDate();
            date.setName(String.valueOf(i));
            date.setValue((int) (Math.random()*101));
        }
        return  list;
    }


}
